import { createRouter, createWebHashHistory } from 'vue-router'
import createRouteGuard from './guard'
import home from '../layout/index.vue'

const routes: any = [
  {
    path: '/:catchAll(.*)', // 不识别的path自动匹配404
    component: () => import('../views/error/404/index.vue'),
  },

  {
    path: '/cvmagic/login',
    title: '登入',
    component: () => import('@/views/login/index.vue'),
  },
]

const router = createRouter({
  history: createWebHashHistory(),
  routes,
})

/**
 * 路由守卫
 */
createRouteGuard(router)

export default router
